from page import Page
from page1 import Page1
from page2 import Page2
import pytest
from selenium import webdriver

@pytest.fixture(scope='function')
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    driver.implicitly_wait(10)
    yield driver
    driver.close()
    driver.quit()

def test_01(driver):
    po = Page(driver)
    po.url('https://www.sogou.com/')
    po.home_loc()

def test_02(driver):
    po = Page1(driver)
    po.url('https://www.sogou.com/')
    po.input_loc()
    po.dian_loc()
    print(po.dy_loc())
def test_03(driver):
    po = Page1(driver)
    po.url('https://www.sogou.com/')
    po.input_loc()
    po.dian_loc()
    print(po.dy_loc())
    assert "软件测试" in po.dy_loc()

def test_04(driver):
    po = Page2(driver)
    po.url('https://www.sogou.com/')
    po.input_loc()
    po.dian_loc()
    po.dy_loc()
    assert "软件测试" in po.dy_loc()
    po.two_loc()
    print(po.dy1_loc())
    assert "软件测试" in po.dy1_loc()
